<template>
  <div>
    <p v-for="(team,index) in list1" :key="index">
      <span>{{team.name}}</span>
      <span>，电话：{{team.phone}}</span>
      <button>拨号</button>
      <button @click="edit(index)">编辑</button>
      <button @click="del(index)">删除</button>
    </p>
  </div>
</template>

<script>
export default {
  props: ['list1'],
  methods: {
    del(index) {
      // 子传父，告诉父组件要删除谁
      this.$emit('del', index);
    },
    edit(index) {
      // 子传父，打开弹窗，准备修改
      this.$emit('edit', index)
    }
  },
}
</script>

<style>

</style>